package com.ruoyi.web.controller.video;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.video.VsLangInit;
import com.ruoyi.system.service.video.IVsLangInitService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * This file is part of 南阳迈特网络科技有限公司.
 * @company  南阳迈特网络科技有限公司
 * @link     https://www.nymaite.com
 * @document https://product.nymaite.cn
 * @contact  service@nymaite.com
 * @author nymaite
 */
/**
 * 语言包的初始化信息Controller
 * 
 * @author zzx
 * @date 2024-06-11
 */
//@Api(tags = "语言包的初始化信息")
@RestController
@RequestMapping("/lang/init")
public class VsLangInitController extends BaseController
{
    @Autowired
    private IVsLangInitService vsLangInitService;

    /**
     * 查询语言包的初始化信息列表
     */
//    @ApiOperation("查询语言包的初始化信息列表")
    @GetMapping("/list")
    public TableDataInfo list(VsLangInit vsLangInit)
    {
//        startPage();
        List<VsLangInit> list = vsLangInitService.selectVsLangInitList(vsLangInit);
        return getDataTable(list);
    }

    /**
     * 导出语言包的初始化信息列表
     */
//    @ApiOperation("导出语言包的初始化信息列表")
    @Log(title = "语言包的初始化信息", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, VsLangInit vsLangInit)
    {
        List<VsLangInit> list = vsLangInitService.selectVsLangInitList(vsLangInit);
        ExcelUtil<VsLangInit> util = new ExcelUtil<VsLangInit>(VsLangInit.class);
        util.exportExcel(response, list, "语言包的初始化信息数据");
    }

    /**
     * 获取语言包的初始化信息详细信息
     */
//    @ApiOperation("获取语言包的初始化信息详细信息")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(vsLangInitService.selectVsLangInitById(id));
    }

    /**
     * 新增语言包的初始化信息
     */
//    @ApiOperation("新增语言包的初始化信息")
    @Log(title = "语言包的初始化信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody VsLangInit vsLangInit)
    {
        return toAjax(vsLangInitService.insertVsLangInit(vsLangInit));
    }

    /**
     * 修改语言包的初始化信息
     */
//    @ApiOperation("修改语言包的初始化信息")
    @Log(title = "语言包的初始化信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody VsLangInit vsLangInit)
    {
        return toAjax(vsLangInitService.updateVsLangInit(vsLangInit));
    }

    /**
     * 删除语言包的初始化信息
     */
//    @ApiOperation("删除语言包的初始化信息")
    @Log(title = "语言包的初始化信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(vsLangInitService.deleteVsLangInitByIds(ids));
    }
}
